package com.push_label.controller;


import com.push_label.bean.channel.ChannelInfo;
import com.push_label.bean.customer.CustomerInfo;
import com.push_label.bean.order.OrderStatusInfo;
import com.push_label.bean.product.ProductInfo;
import com.push_label.common.Result;
import com.push_label.server.ChannelService;
import com.push_label.server.CustomerService;
import com.push_label.server.OrderService;
import com.push_label.server.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Slf4j
@RequestMapping("/basic")
public class BasicController {


    @Resource
    private ProductService productService;
    @Resource
    private ChannelService channelService;
    @Resource
    private CustomerService customerService;
    @Resource
    private OrderService orderService;


    @GetMapping("/product")
    Result<List<ProductInfo>> getAllProduct() {
        return Result.success(productService.getAllProduct());
    }


    @GetMapping("/channel")
    Result<List<ChannelInfo>> getAddChannel() {
        return Result.success(channelService.getAddChannel());
    }

    @GetMapping("/customer")
    Result<List<CustomerInfo>> selectAllCustomerInfo() {
        return Result.success(customerService.selectAllCustomerInfo());
    }

    @GetMapping("/orderStatus")
    Result<List<OrderStatusInfo>> selectAllOrderStatusInfo() {
        return Result.success(orderService.selectAllOrderStatusInfo());
    }

}
